CRONO SDK 1.0.1
CRONO_SDK_Example.c
/*
#######################################
Copyright 2024 Micro-Photon-Devices s.r.l.
SOFTWARE PRODUCT: CRONO_SDK
Micro-Photon-Devices (MPD) expressly disclaims any warranty for the SOFTWARE PRODUCT.
The SOFTWARE PRODUCT is provided 'As Is' without any express or implied warranty of any kind,
including but not limited to any warranties of merchantability, noninfringement, or
fitness of a particular purpose. MPD does not warrant or assume responsibility for the
accuracy or completeness of any information, text, graphics, links or other items contained
within the SOFTWARE PRODUCT. MPD further expressly disclaims any warranty or representation
to Authorized Users or to any third party.
In no event shall MPD be liable for any damages (including, without limitation, lost profits,
business interruption, or lost information) rising out of 'Authorized Users' use of or inability
to use the SOFTWARE PRODUCT, even if MPD has been advised of the possibility of such damages.
In no event will MPD be liable for loss of data or for indirect, special, incidental,
consequential (including lost profit), or other damages based in contract, tort
or otherwise. MPD shall have no liability with respect to the content of the
SOFTWARE PRODUCT or any part thereof, including but not limited to errors or omissions contained
therein, libel, infringements of rights of publicity, privacy, trademark rights, business
interruption, personal injury, loss of privacy, moral rights or the disclosure of confidential
information.
#######################################
*/
#include "CRONO_SDK.h"
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>
#if defined(__linux__)
#define SLEEP usleep
#define MILLIS 1000
#elif defined(__APPLE__)
#define SLEEP usleep
#define MILLIS 1000
#include <unistd.h>
#elif defined(_WIN32)
#include <Windows.h>
#define SLEEP Sleep
#define MILLIS 1
#endif
//*************************************//
// //
// Support functions //
// //
//*************************************//
//clear screen
void clear_screen()
{
#ifdef _WIN32
system("cls");
#else
// Assume POSIX
system("clear");
#endif
}
// Calculate the mean value of a uint16_t image
double meanImage(uint32_t * Img, uint16_t NPixel)
{
int i=0;
double res =0.0;
for(i=0;i<NPixel;i++)
res+= (double)Img[i];
return res/(double)NPixel;
}
// Create an accumulated histogram over the imager
void AccHist(uint32_t* HistIn, uint32_t* HistOut, int Npixel)
{
for (int i = 0; i < 4096; i++)
{
for (int j = 0; j < Npixel; j++)
{
HistOut[i] += *(HistIn + j * 4096 + i);
}
}
}
// Print some status info
void print_status(CRONO_AcquisitionStatus s)
{
double acquisitionTime = (s.acquisitionTime);
int64_t capturedFrameCount = (s.capturedFrameCount);
int64_t decodedFrameCount = (s.decodedFrameCount);
int64_t deviceRamUsageBytes = (s.deviceRamUsageBytes);
int64_t downloadedBytes = (s.downloadedBytes);
int64_t hostAllocatedBytes = (s.hostAllocatedBytes);
printf(" acquisitionTime = %.1f s\n", acquisitionTime);
printf(" capturedFrameCount = %lld\n", capturedFrameCount);
printf(" decodedFrameCount = %lld\n", decodedFrameCount);
printf("deviceRamUsageBytes = %.1f MB\n", deviceRamUsageBytes * 1e-6);
printf(" downloadedBytes = %.1f MB\n", downloadedBytes * 1e-6);
printf(" dl rate = %.1f MB/s\n", 1e-6 * (downloadedBytes / acquisitionTime));
printf(" hostAllocatedBytes = %.1f MB\n", hostAllocatedBytes * 1e-6);
}
//***********************************//
// //
// Main code //
// //
//***********************************//
int main(void)
{
// variables definition //
CRONO_H crono= NULL;
cronoBool dataIsNew;
uint32_t* CntsBuf;
uint32_t* HistBuf;
uint32_t* AccHistBuf;
char serial[MAX_SERIAL_LENGTH];
int pattern[10];
int device_count = 0, dev_num, nPixel, loop = 1;
uint64_t num;
uint32_t total;
char c = 0;
double maxFrameStartFrequency, extStartFreq, extGateFreq, extTrigFreq, average;
char *menu_strings[] = {
"Live counting mode: write on stdout an image", //a
"Live timing mode: write on stdout an histogram", //b
"Acquisition timing mode: get time tagging, frames and histogram", //c
"Holdoff: mean number of photons at different holdoff values", //d
"Save settings to file", //e
"Load settings from file", //f
"Configure outputs", //g
"Acquire with external start", //h
"Acquire with external gate and aux-input timetagging", //i
"Use external trigger", //j
"Load raw data from file" //k
};
printf("\n*******************************************************************************\n");
printf(" CRONO SDK Example\n");
printf("*******************************************************************************\n");
CRONO_Constr(&crono);
CRONO_GetDeviceCount(crono, &device_count);
printf("Found %d CRONO devices: \n", device_count);
for (int d = 0; d < device_count; d++) {
CRONO_GetDeviceSerial(crono, d, serial);
printf("%d: %s\n", d+1, serial);
}
printf("\nChoose a device:\n");
scanf("%d", &dev_num);
getchar();
CRONO_GetDeviceSerial(crono, dev_num-1, serial);
err = CRONO_OpenDeviceBySerial(crono, serial);
if (!err) {
printf("\nSUCCESSFUL!\nCamera with serial number %s Opened.\n", serial);
}
else {
printf("Error %i !\n", err);
return -1;
}
CRONO_GetDeviceInfo(crono, "", &devInfo);
switch (devInfo.SensorType)
{
case CRONO_8X8:
printf("Sensor Type: Crono 8x8\n");
nPixel = 64;
break;
printf("Sensor Type: Crono 128x1\n");
nPixel = 128;
break;
default:
printf("Error, invalid sensor type\n");
return -1;
}
printf("FW version: %d.%d.%d\n", devInfo.FwMajorVersion, devInfo.FwMinorVersion, devInfo.FwPatchVersion);
printf("SDK version: %d.%d.%d\n", devInfo.SdkMajorVersion, devInfo.SdkMinorVersion, devInfo.SdkPatchVersion);
CntsBuf = (uint32_t*)calloc(nPixel, sizeof(uint32_t));
HistBuf = (uint32_t*)calloc(4096 * nPixel, sizeof(uint32_t));
AccHistBuf = (uint32_t*)calloc(4096, sizeof(uint32_t));
//initial configuration
//config sensor
err += CRONO_ConfigSensor(crono, nPixel, 1, 1, &maxFrameStartFrequency);
//set deadtime
err += CRONO_SetSpadDeadTime(crono, 50);
//config acquisition
err += CRONO_ConfigAcquisition(crono, COUNTING, 0, 0, 0, 1,0, "");
//config internal start
err += CRONO_ConfigFrameStartInternal(crono, maxFrameStartFrequency, NULL);
//config internal gate
pattern[0] = 0;
pattern[1] = 700;
err += CRONO_ConfigGateInternal(crono, pattern, 2);
if (err != 0)
{
loop = 0;
printf("Configuration error!");
}
while (loop) {
// ------ MENU --------------------------------------------------------
printf("\n*******************************************************************************\n");
printf(" Choose an option\n");
printf("*******************************************************************************\n");
for (int i = 0; i < sizeof(menu_strings) / sizeof(char*); i++) {
printf("\t%c) %s\n", i + 'a', menu_strings[i]);
}
printf("\tq) Quit\n> ");
c = getchar();
getchar();
if (c >= 'a' && c <= 'a' + sizeof(menu_strings) / sizeof(char*) - 1) {
printf("*******************************************************************************\n");
printf("%s\n", menu_strings[c - 'a']);
printf("*******************************************************************************\n");
}
switch (c)
{
case 'a'://Test live counting mode
CRONO_ConfigAcquisition(crono, COUNTING, 0, 0, 0, 1, 0, "");
CRONO_StartAcquisition(crono, 0, 100);
dataIsNew = 0;
while (!dataIsNew)
{
SLEEP(10);
CRONO_GetLiveData(crono, CntsBuf, NULL, &dataIsNew);
}
printf("Acquired counts per pixel:\n");
for (int i = 0; i < nPixel; i++)
{
printf("%d\n", *(CntsBuf + i));
}
printf("\n\tAcquisition status:\n");
CRONO_GetAcquisitionStatus(crono, &status);
print_status(status);
break;
case 'b'://Test live timing mode
CRONO_ConfigAcquisition(crono, TIMING, 0, 0, 0, 1, 0, "");
CRONO_StartAcquisition(crono, 0, 1000);
dataIsNew = 0;
while (!dataIsNew)
{
SLEEP(10);
CRONO_GetLiveData(crono, CntsBuf, HistBuf, &dataIsNew);
}
total = 0;
for (int j = 0; j < nPixel; j++)
total += CntsBuf[j];
printf("\nTotal events in frame: %d\n", total);
total = 0;
AccHist(HistBuf, AccHistBuf, nPixel);
for (int j = 0; j < 4094; j++)
total += AccHistBuf[j];
printf("\nTotal events in histogram: %d\n", total);
printf("Accumulated histogram for all pixels:");
for (int i = 0; i < 4096; i++)
{
printf("%d\n", *(AccHistBuf + i));
}
printf("\n\tAcquisition status:\n");
CRONO_GetAcquisitionStatus(crono, &status);
print_status(status);
break;
case 'c': //Test acquisition timing mode
CRONO_ConfigAcquisition(crono, TIMING, 1, 1, 1, 0, 0, "");
CRONO_StartAcquisition(crono, 100000, 1000);
CRONO_GetAcquisitionStatus(crono, &status);
while (status.ongoing)
{
SLEEP(100);
err = CRONO_GetAcquisitionStatus(crono, &status);
if (!err)
{
clear_screen();
printf(" **********************\n");
printf(" * Acquisition status *\n");
printf(" **********************\n");
print_status(status);
}
else
printf("\nError %d", err);
}
SLEEP(1000);
err = CRONO_GetAcquisitionStatus(crono, &status);
printf("\nAvailable histograms: %lld\n",status.availableHistogramCount);
printf("Available frames: %lld\n", status.availableFramesCount);
printf("Available time-tags: %lld\n", status.availableTimeTagsCount);
free(AccHistBuf);
AccHistBuf = (uint32_t*)calloc(4096, sizeof(uint32_t));
total = 0;
for (int i = 0; i < status.availableHistogramCount; i++)
{
CRONO_GetHistogramData(crono, HistBuf, 1, &num);
if (num != 1)
break;
AccHist(HistBuf, AccHistBuf, nPixel);
}
for (int j = 0; j < 4096; j++)
total += AccHistBuf[j];
printf("\nTotal events in histogram: %d\n", total);
break;
case 'd': //Test holdoff effect
for (int h = 50; h < 151; h = h + 50)
{
printf("\n ** Deadtime %d ns **\n", h);
CRONO_ConfigAcquisition(crono, COUNTING, 1, 0, 0, 0, 0, "");
CRONO_StartAcquisition(crono, 1000, 1000);
while (status.ongoing)
{
SLEEP(100);
CRONO_GetAcquisitionStatus(crono, &status);
}
print_status(status);
printf("\nAvailable accumulated frames: %lld\n", status.availableFramesCount);
CRONO_GetFramesData(crono, CntsBuf, 1, &num);
if (num != 1)
break;
average = meanImage(CntsBuf, nPixel);
printf("\nAverage counts: %.2f at %d ns deadtime\n\n", average,h);
printf("-----------------------------------------\n");
}
break;
case 'e': // Save settings to file
err = CRONO_SaveSettingsToFile(crono, "crono_example.ccf");
if (err)
{
printf("\nCannot save settings!\n");
break;
}
printf("\nSettings saved to file crono_example.ccf\n");
break;
case 'f': // Load settings from file
CRONO_GetCameraSettings(crono, &settings);
printf("\nActual deadtime: %d ns\n", settings.deadTimeNs);
err = CRONO_LoadSettingsFromFile(crono, "crono_example.ccf");
if (err)
{
printf("\nCannot load settings!\n");
break;
}
printf("\nSettings loaded from file crono_example.ccf\n");
CRONO_GetCameraSettings(crono, &settings);
printf("\nLoaded deadtime: %d ns\n", settings.deadTimeNs);
break;
case 'g': // Configure outputs
//config outputs: laser, start, gate
CRONO_ConfigOutputs(crono, 0, 0, 0);
//config laser pattern: 50ns off, 10ns on
pattern[0] = 50;
pattern[1] = 10;
CRONO_ConfigLaserSync(crono, pattern, 2);
//config gate pattern
pattern[0] = 0;
pattern[1] = 200;
CRONO_ConfigGateInternal(crono, pattern, 2);
CRONO_ConfigAcquisition(crono, TIMING, 0, 0, 0, 1, 0, "");
printf("Acquisition will now start and run for 10s.\n\n");
printf("Output 1 is configured for laser sync: 50ns off, 10ns on.\n");
printf("Output 2 is configured for start sync at %3f MHz.\n", maxFrameStartFrequency*1e-6);
printf("Output 3 is configured for gate: 0ns off, 200ns on.\n\n");
CRONO_StartAcquisition(crono, 0, 1000);
for (int i = 1; i <= 10; i++)
{
SLEEP(1000);
printf("%ds elapsed...\n",i);
}
printf("\nAcquisition ended.\n");
break;
case 'h': // Acquire with external start
printf("Apply an external start signal at max frequency of 1MHz, and amplitude of 3.3V, and press ENTER when ready.\n");
printf("Note that acquisition will not progress if the signal is not applied or paused.\n");
getchar();
CRONO_ConfigFrameStartExternal(crono, 1000000, 1.5, 1, 10);
CRONO_ConfigAcquisition(crono, TIMING, 0, 1, 0, 0, 0, "");
CRONO_StartAcquisition(crono, 100000, 1000);
CRONO_GetAcquisitionStatus(crono, &status);
while (status.ongoing)
{
SLEEP(100);
err = CRONO_GetAcquisitionStatus(crono, &status);
if (!err)
{
clear_screen();
printf(" **********************\n");
printf(" * Acquisition status *\n");
printf(" **********************\n");
print_status(status);
CRONO_GetInputFrequencies(crono, &extStartFreq, &extGateFreq, &extTrigFreq);
printf("External start frequency: %.3f MHz\n", extStartFreq*1e-6);
}
else
printf("\nError %d", err);
}
//restore internal start
CRONO_ConfigFrameStartInternal(crono, maxFrameStartFrequency, NULL);
break;
case 'i': // Acquire with external gate and aux-input timetagging
CRONO_ConfigFrameStartInternal(crono, 1000000, NULL);
CRONO_ConfigGateExternal(crono, 1.5, 0);
printf("Camera is now configured for using external gate and time tagging pulses on trigger input.\n");
printf("Apply an external gate signal at max frequency of 100MHz, and amplitude of 3.3V, and press ENTER when ready.\nNote that there are timetags due to detected photons.");
getchar();
CRONO_ConfigAcquisition(crono, TIMING, 1, 1, 1, 0, 0, "");
CRONO_StartAcquisition(crono, 100000, 1000);
CRONO_GetAcquisitionStatus(crono, &status);
while (status.ongoing)
{
SLEEP(100);
err = CRONO_GetAcquisitionStatus(crono, &status);
if (!err)
{
clear_screen();
printf(" **********************\n");
printf(" * Acquisition status *\n");
printf(" **********************\n");
print_status(status);
CRONO_GetInputFrequencies(crono, &extStartFreq, &extGateFreq, &extTrigFreq);
printf("External gate frequency: %.3f MHz\n", extGateFreq*1e-6);
}
else
printf("\nError %d", err);
}
printf("\nAvailable histograms: %lld\n", status.availableHistogramCount);
printf("Available frames: %lld\n", status.availableFramesCount);
printf("Available time-tags: %lld\n", status.availableTimeTagsCount);
printf("Now remove gate signal and press ENTER when ready. Note there are no more timetags\n");
getchar();
CRONO_StartAcquisition(crono, 100000, 1000);
CRONO_GetAcquisitionStatus(crono, &status);
while (status.ongoing)
{
SLEEP(100);
err = CRONO_GetAcquisitionStatus(crono, &status);
if (!err)
{
clear_screen();
printf(" **********************\n");
printf(" * Acquisition status *\n");
printf(" **********************\n");
print_status(status);
CRONO_GetInputFrequencies(crono, &extStartFreq, &extGateFreq, &extTrigFreq);
printf("External gate frequency: %.3f MHz\n", extGateFreq*1e-6);
}
else
printf("\nError %d", err);
}
printf("\nAvailable histograms: %lld\n", status.availableHistogramCount);
printf("Available frames: %lld\n", status.availableFramesCount);
printf("Available time-tags: %lld\n", status.availableTimeTagsCount);
printf("Now apply a 3.3V signal to the trigger input and press ENTER when ready.\nNote that, despite no gate is applied, there are now timetags due to pulses into trigger input.\n");
getchar();
CRONO_StartAcquisition(crono, 100000, 1000);
CRONO_GetAcquisitionStatus(crono, &status);
while (status.ongoing)
{
SLEEP(100);
err = CRONO_GetAcquisitionStatus(crono, &status);
if (!err)
{
clear_screen();
printf(" **********************\n");
printf(" * Acquisition status *\n");
printf(" **********************\n");
print_status(status);
CRONO_GetInputFrequencies(crono, &extStartFreq, &extGateFreq, &extTrigFreq);
printf("External gate frequency: %.3f MHz\n", extGateFreq*1e-6);
printf("Aux (trigger-in) frequency: %.3f MHz\n", extTrigFreq*1e-6);
}
else
printf("\nError %d", err);
}
printf("\nAvailable histograms: %lld\n", status.availableHistogramCount);
printf("Available frames: %lld\n", status.availableFramesCount);
printf("Available time-tags: %lld\n", status.availableTimeTagsCount);
printf("Aux B counts: %lld\n", status.auxBitBCount);
//restore internal gate and no aux inputs
CRONO_ConfigGateInternal(crono, pattern, 2);
//restore internal start frequency
CRONO_ConfigFrameStartInternal(crono, maxFrameStartFrequency, NULL);
break;
case 'j': // Use external trigger
printf("Camera is now in triggered mode, for each trigger pulse 50 frames will be acquired up to 500 frames.\n");
printf("Acquisition will now start.\n");
printf("Apply single trigger pulses and note that captured frames number increases accordingly, up to 500, and then they are downloaded and decoded.\n");
printf("Press ENTER when ready.\n");
getchar();
CRONO_ConfigOutputs(crono, 0, 0, 0);
CRONO_ConfigAcquisition(crono, TIMING, 0, 1, 0, 1, 0, "");
CRONO_StartAcquisition(crono, 500, 50);
CRONO_GetAcquisitionStatus(crono, &status);
while (status.ongoing)
{
SLEEP(100);
err = CRONO_GetAcquisitionStatus(crono, &status);
if (!err)
{
clear_screen();
printf(" **********************\n");
printf(" * Acquisition status *\n");
printf(" **********************\n");
print_status(status);
}
else
printf("\nError %d", err);
}
//restore internal trigger
break;
case 'k': //Save raw data to file, reload it and count events in histograms
//acquiring data
printf("\nAcquiring data and saving to file acquisition.raw\n");
printf("\nPress ENTER to start the acquisition and then reopen the file.");
getchar();
//configure to only save raw data to file
CRONO_ConfigAcquisition(crono, TIMING, 0, 0, 0, 0, 0, "acquisition.raw.dat");
CRONO_StartAcquisition(crono, 100000, 1000);
CRONO_GetAcquisitionStatus(crono, &status);
while (status.ongoing)
{
SLEEP(100);
err = CRONO_GetAcquisitionStatus(crono, &status);
if (!err)
{
clear_screen();
printf(" **********************\n");
printf(" * Acquisition status *\n");
printf(" **********************\n");
print_status(status);
}
else
printf("\nError %d", err);
}
//open raw data as data converter
printf("\nRaw file acquisition.raw.dat created. Now closing physical device and opening the file.\n");
CRONO_Destr(crono);
crono = NULL;
CRONO_Constr(&crono);
err = CRONO_OpenDeviceAsDataConverter(crono, "acquisition.raw.dat");
if (!err) {
printf("\nSUCCESSFUL!\nRaw file acquisition.raw.dat opened.\n");
}
else {
printf("Error %i !\n", err);
loop = 0;
break;
}
//get acquisition info and settings to properly configure playback
CRONO_GetAcquisitionInfo(crono, &acqInfo);
printf("Acquisition time: %s\n", acqInfo.DateTime);
printf("Number of frames: %lld\n\n", acqInfo.acquiredFramesCount);
CRONO_GetCameraSettings(crono, &settings);
printf("\nPress ENTER to start reading the raw file.");
getchar();
//configure and run playback
CRONO_ConfigAcquisition(crono, settings.countingMode, 1, 1, 1, 0, 0, "");
CRONO_GetAcquisitionStatus(crono, &status);
while (status.ongoing)
{
SLEEP(100);
err = CRONO_GetAcquisitionStatus(crono, &status);
if (!err)
{
clear_screen();
printf(" **********************\n");
printf(" * Acquisition status *\n");
printf(" **********************\n");
print_status(status);
}
else
printf("\nError %d", err);
}
err = CRONO_GetAcquisitionStatus(crono, &status);
printf("\nAvailable histograms: %lld\n", status.availableHistogramCount);
printf("Available frames: %lld\n", status.availableFramesCount);
printf("Available time-tags: %lld\n", status.availableTimeTagsCount);
free(AccHistBuf);
AccHistBuf = (uint32_t*)calloc(4096, sizeof(uint32_t));
total = 0;
for (int i = 0; i < status.availableHistogramCount; i++)
{
CRONO_GetHistogramData(crono, HistBuf, 1, &num);
if (num != 1)
break;
AccHist(HistBuf, AccHistBuf, nPixel);
}
for (int j = 0; j < 4096; j++)
total += AccHistBuf[j];
printf("\nTotal events in histogram: %d\n", total);
//reopen physical device
CRONO_Destr(crono);
crono = NULL;
CRONO_Constr(&crono);
err = CRONO_OpenDeviceBySerial(crono, serial);
if (!err) {
printf("\nSUCCESSFUL!\nCamera with serial number %s opened.\n", serial);
}
else {
printf("Error %i !\n", err);
loop = 0;
break;
}
//reconfigure physical device
err += CRONO_ConfigSensor(crono, nPixel, 1, 1, &maxFrameStartFrequency);
err += CRONO_SetSpadDeadTime(crono, 50);
err += CRONO_ConfigAcquisition(crono, COUNTING, 0, 0, 0, 1, 0, "");
err += CRONO_ConfigFrameStartInternal(crono, maxFrameStartFrequency, NULL);
pattern[0] = 0;
pattern[1] = 700;
err += CRONO_ConfigGateInternal(crono, pattern, 2);
if (err != 0)
{
loop = 0;
printf("Configuration error!");
}
break;
case 'q':
loop = 0;
break;
}
}
// Destructors //
if(crono)
CRONO_Destr(crono);
crono = NULL;
free(CntsBuf);
free(HistBuf);
free(AccHistBuf);
printf("Press ENTER to continue\n");
getchar();
return 0;
}
CRONO software development kit.
CRONO_Return CRONO_SaveSettingsToFile(CRONO_H crono, char *path)
Saves current settings to file.
CRONO_Return CRONO_LoadSettingsFromFile(CRONO_H crono, char *path)
Loads Crono settings from a file.
CRONO_Return CRONO_GetCameraSettings(CRONO_H crono, CRONO_CameraSettings *settings)
Gets actual Crono settings and saves them in a user provided CRONO_CameraSettings struct passed by re...
CRONO_Return CRONO_ConfigAcquisition(CRONO_H crono, CRONO_PixelMode pixelMode, cronoBool framesEnable, cronoBool histogramsEnable, cronoBool timeTagsEnable, cronoBool liveEnable, cronoBool unused, const char *rawDataOutPath)
configures the acquisition modes and selects the output data formats.
CRONO_Return CRONO_ConfigSensor(CRONO_H crono, int activePixels, cronoBool half1Enable, cronoBool half2Enable, double *maxFrameStartFrequency)
Configures the Crono spad array sensor region of interest, i.e.
CRONO_Return CRONO_SetSpadDeadTime(CRONO_H crono, int deadTimeNs)
Sets the SPADs dead time in ns.
CRONO_Return CRONO_ConfigTriggerExternal(CRONO_H crono, int framesBurstCount)
Sets the camera in external trigger mode.
CRONO_Return CRONO_ConfigAuxiliaryInputs(CRONO_H crono, CRONO_AuxInputMode bitModeA, CRONO_AuxInputMode bitModeB, double bitAThreshold)
Configure aux inputs sampling.
CRONO_Return CRONO_ConfigGateExternal(CRONO_H crono, double threshold, cronoBool externalGateInvert)
Sets the camera in external gate mode and configure the associated parameters.
CRONO_Return CRONO_GetInputFrequencies(CRONO_H crono, double *extStartFrequency, double *extGateFrequency, double *extTriggerFrequency)
Gets the current meaured input signal frequencies at the SMA inputs.
CRONO_Return CRONO_ConfigOutputs(CRONO_H crono, int chan1Selection, int chan2Selection, int chan3Selection)
Configures which Crono signals are forwarded to each of the three output ports.
CRONO_Return CRONO_ConfigFrameStartExternal(CRONO_H crono, double frameRate, double threshold, cronoBool externalStartPosedge, int divFactor)
Sets the camera in external frame start mode and configure the associated parameters.
CRONO_Return CRONO_ConfigLaserSync(CRONO_H crono, int *pattern, int patternLen)
Configures the pattern of internally generated laser syncronization signal.
CRONO_Return CRONO_ConfigGateInternal(CRONO_H crono, int *pattern, int patternLen)
Set the camera in internal gate mode and configures the pattern of internally generated gate.
CRONO_Return CRONO_ConfigTriggerInternal(CRONO_H crono)
Sets the camera in internal trigger mode.
CRONO_Return CRONO_ConfigFrameStartInternal(CRONO_H crono, double frameRate, double *actualBin)
Sets the camera in internal frame start mode and sets the frame start rate.
CRONO_Return CRONO_Destr(CRONO_H crono)
Frees all resources owned by a Crono handle.
CRONO_Return CRONO_Constr(CRONO_H *crono)
Constructs a new Crono object.
CRONO_Return CRONO_StopAcquisition(CRONO_H crono, cronoBool force)
Stops an ongoing acquisition.
CRONO_Return CRONO_GetHistogramData(CRONO_H crono, uint32_t *buf, uint64_t capacityNumHists, uint64_t *copiedNumHists)
Gets an acquisition data chuck in histogram format.
CRONO_Return CRONO_GetAcquisitionStatus(CRONO_H crono, CRONO_AcquisitionStatus *status)
Gets the current acquisition status.
CRONO_Return CRONO_GetLiveData(CRONO_H crono, uint32_t *countsBuf, uint32_t *histogramBuf, cronoBool *dataIsNew)
Gets latest live data whenever available.
CRONO_Return CRONO_GetFramesData(CRONO_H crono, uint32_t *buf, uint64_t capacityNumFrames, uint64_t *copiedNumFrames)
Gets an acquisition data chuck in frames format.
CRONO_Return CRONO_GetAcquisitionInfo(CRONO_H crono, CRONO_AcquisitionInfo *acqInfo)
Gets informations about the last acquisition.
CRONO_Return CRONO_StartAcquisition(CRONO_H crono, uint64_t acqMaxFrames, int integPeriodFrames)
Starts a new acquisition.
#define MAX_SERIAL_LENGTH
Maximum serial number string length.
Definition: CRONO_SDK.h:87
CRONO_Return CRONO_GetDeviceCount(CRONO_H crono, int *count)
Gets the count of all active and connected Crono devices.
CRONO_Return CRONO_OpenDeviceBySerial(CRONO_H crono, char *serial)
Opens a device with a given serial number.
CRONO_Return CRONO_GetDeviceInfo(CRONO_H crono, char *serial, CRONO_DeviceInfo *deviceInfo)
Gets information about a device with a given serial number, or of the already open device.
CRONO_Return CRONO_GetDeviceSerial(CRONO_H crono, int deviceIndex, char *buf)
Get the serial number of a connected Crono device given its numeric index.
CRONO_Return CRONO_OpenDeviceAsDataConverter(CRONO_H crono, char *rawFilePath)
Open saved Crono raw file as a virtual device for data conversion.
uint64_t acquiredFramesCount
Number of acquired frames.
Definition: CRONO_SDK.h:167
int deadTimeNs
SPAD deadtime in ns.
Definition: CRONO_SDK.h:214
int64_t decodedFrameCount
Number of frames decoded by SDK since acquisition start.
Definition: CRONO_SDK.h:196
cronoBool ongoing
Boolean value that indicates wether the acquisition is ongoing.
Definition: CRONO_SDK.h:206
int64_t hostAllocatedBytes
Current ram usage for storing acquired and decoded data on the host computer.
Definition: CRONO_SDK.h:199
int SdkMinorVersion
SDK minor version.
Definition: CRONO_SDK.h:157
int FwMinorVersion
Firmware minor version.
Definition: CRONO_SDK.h:154
int SdkMajorVersion
SDK major version.
Definition: CRONO_SDK.h:156
int64_t deviceRamUsageBytes
Current usage of Crono device RAM expressed in bytes.
Definition: CRONO_SDK.h:197
int SdkPatchVersion
SDK patch version.
Definition: CRONO_SDK.h:158
int64_t capturedFrameCount
Number of frames captured by the camera since acquisition start.
Definition: CRONO_SDK.h:195
CRONO_SensorType SensorType
Sensor type, 128x1 or 8x8.
Definition: CRONO_SDK.h:151
char DateTime[MAX_DATETIME_LENGTH]
Date and time of acquisition.
Definition: CRONO_SDK.h:166
int64_t availableHistogramCount
Number of currently buffered histograms.
Definition: CRONO_SDK.h:203
int FwPatchVersion
Firmware patch version.
Definition: CRONO_SDK.h:155
int64_t downloadedBytes
Number of downloaded bytes on the host computer since acquisition start.
Definition: CRONO_SDK.h:198
int64_t auxBitBCount
Count of bit B samples>.
Definition: CRONO_SDK.h:205
int64_t availableFramesCount
Number of currently buffered frames.
Definition: CRONO_SDK.h:201
int FwMajorVersion
Firmware major version.
Definition: CRONO_SDK.h:153
int64_t availableTimeTagsCount
Number of currently buffered time tags values.
Definition: CRONO_SDK.h:202
CRONO_PixelMode countingMode
Camera operation mode.
Definition: CRONO_SDK.h:220
double acquisitionTime
Elapsed time in seconds since acquisition start.
Definition: CRONO_SDK.h:194
struct Crono * CRONO_H
Type CRONO_H.
Definition: CRONO_SDK.h:102
CRONO_Return
Error table.
Definition: CRONO_SDK.h:108
uint8_t cronoBool
Type cronoBool.
Definition: CRONO_SDK.h:99
@ RISING_EDGE
Sample the auxiliary input on rising edge.
Definition: CRONO_SDK.h:185
@ OFF
Do not sample the auxiliary input.
Definition: CRONO_SDK.h:184
@ CRONO_8X8
8x8 pixels sensor
Definition: CRONO_SDK.h:143
@ CRONO_128X1
128x1 pixels sensor
Definition: CRONO_SDK.h:144
@ TIMING
Event timing mode.
Definition: CRONO_SDK.h:175
@ COUNTING
Event counting mode.
Definition: CRONO_SDK.h:176
Struct containing information about the acquisition.
Definition: CRONO_SDK.h:165
Struct containing the status of an ongoing Crono acquisition.
Definition: CRONO_SDK.h:193
Struct containing camera settings.
Definition: CRONO_SDK.h:213
Struct containing information about the version and connection speed grade of a connected Crono devic...
Definition: CRONO_SDK.h:150